package test.ali;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by shuoGG on 2018/10/25 0025
 */
public class PrintAli {
    private StringBuffer str = new StringBuffer();

    public void printN(int n) {
        ExecutorService executor = Executors.newSingleThreadExecutor();
        for (int i = 0; i < n; i++) {
            executor.execute(() -> str.append("a"));
            executor.execute(() -> str.append("l"));
            executor.execute(() -> str.append("i"));
        }
        executor.execute(() -> System.out.println(str.toString()));
        ;
    }

    public static void main(String[] args) {
        new PrintAli().printN(3);
    }
}
